package main

import (
	"fmt"
	"github.com/lhdhtrc/func-go/process"
	"go-layout/internal/conf"
	"runtime"
)

func main() {
	bootstrapConf := conf.NewBootstrapConf()

	app, err := wireApp(bootstrapConf)
	if err != nil {
		panic(err)
		return
	}

	go app.Start()

	app.Logger.Info(fmt.Sprintf("system self check completed，current goroutine num - %d", runtime.NumGoroutine()))
	process.Watcher(func() {
		app.Logger.Info("uninstall all service for this node from the register")
	})
}
